<h1>
        <span class="action-span1">
		<a href="javascript:void(0);">系统设置</a>---<a href="javascript:void(0);">发送邮件</a>
	</span>
	<div style="clear:both"></div>
</h1>

  <!-- start user list -->
<div class="list-div" id="listDiv">
    <form action="./index.php" method="get" >
        <input type="hidden" name="c" value="mail">
  	<input type="hidden" name="a" value="sendMail">
        <input type="hidden" name="noticeID" value="<?=$noticeID;?>">
<table cellpadding="3" cellspacing="1">
  <tr>
    <th width="25%">邮件标题：</th>
    <td><input type="text" style="width:677px;" value="" name="title"></td>
  </tr>
  <tr>
    <th width="25%">发件人id：</th>
    <td><select name="sendInfo" id="sendInfo" style="width:150px;">
         <?php foreach($sendInfo as $v ): ?>
            <option value="<?=$v['id'].'-'.$v['userName']?>" na="<?=$v['userID']?>"><?=$v['userName']?></option>
         <?php endforeach;?>
        </select></td>
  </tr>
  <tr>
    <th width="25%">收件人id：</th>
    <td><select name="acceptInfo" id="acceptInfo" style="width:150px;">
        </select></td>
  </tr>
  <tr>
    <th>邮件内容：</th>
    <td><textarea name="descripe" rows="9" cols="94"><?=$notice['describe'];?></textarea></td>
  </tr>
  <tr>
    <th>筹码数：</th>
    <td><input type="text" style="width:677px;" value="" name="jetton"></td>
  </tr>
  <tr>
    <th colspan='2'><input type='submit' value='提交' style='width:100px;'></th>
  </tr>
  </table>
       </form>
<!-- end goods list -->

<!-- 分页 -->
</div>
  
<script type="text/javascript">
    $(document).ready(function(){
        var user = $('#sendInfo').val();
        var userArr = user.split('-');
        getFriendInfo(userArr[0]);
        
        $('#sendInfo').change(function(){
            var user = $(this).val();
            var userArr = user.split('-');
            getFriendInfo( userArr[0]  );
        })
    })
    
    function getFriendInfo(uid){
        $.post( '/index.php?c=mail&a=getUserFriend&userID='+uid,
            function(e){
                if(e){
                    e = eval("("+e+")");
                    var html = '';
                    for( var i=0 ; i< e.length ; i++ ){
                        html = "<option value='"+e[i].fID+"-"+e[i].fName+"' na='"+e[i].fID+"'>"+e[i].fName+"</option>";
                    }
                    $("#acceptInfo").html(html);
                }else{
                    alert('请先添加好友！');
                }
        })
    }
</script>